<%--
  Created by IntelliJ IDEA.
  User: fire'ge
  Date: 2022/3/26
  Time: 20:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8"  isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<link rel="stylesheet" href="/jspdemo/css/UserManage.css" type="text/css">
<head>
    <title>用户表</title>
</head>
<body>
<div>
    <form action="/jspdemo/checkServlet" >
        <table>
            <tr>
                <td align="center" colspan="4">你好！${user.name}
                <a href="/jspdemo/jsp/MainMenu.jsp">返回</a>  </td>

            </tr>
            <tr>
                <td><input type="button" id="add" value="新增" class="button"></td>
                <td colspan="2"> username查询：<input type="text" name="factor"></td>
                <td> <input type="submit" value="查 找" class="button"></td>
            </tr>
            <tr>
                <td>id号</td>
                <td>用户名</td>
                <td>密码</td>
                <td>操作</td>
            </tr>
            <c:forEach items="${users}" var="user">
                <tr>
                    <td>${user.id}</td>
                    <td>${user.name}</td>
                    <td>${user.pwd}</td>
                    <td><a href="#">修改</a> <a href="#">删除</a>
                    </td>
                </tr>
            </c:forEach>
            <tr>
                <td>共 ${rows} 条</td>
                <td  colspan="3"> 第
                <c:forEach begin="0" end="${rows/9}" var="page" step="1">
                        <a href="/jspdemo/checkServlet?start=${page*9}&factor=${factor2}">${page+1}</a>
                </c:forEach>
                    页 </td>

            </tr>
    </form>
</div>

<script>
    document.getElementById("add").onclick = function () {
        location.href = "jsp/addData.jsp";
    }
</script>
</body>
</html>
